#ifndef MUSICSLIDER_H
#define MUSICSLIDER_H

#include <QWidget>

namespace Ui {
class MusicSlider;
}

class MusicSlider : public QWidget
{
    Q_OBJECT

public:
    explicit MusicSlider(QWidget *parent = nullptr);

    void setMusicSliderValue(float);

    ~MusicSlider();
protected:
    void mousePressEvent(QMouseEvent*);

    void mouseReleaseEvent(QMouseEvent*);

    void mouseMoveEvent(QMouseEvent*);

    void moveSlider();
signals:
    void setMusicSliderPosition(float ratio);

private:
    Ui::MusicSlider *ui;

    int currentPos; //播放进度

    int maxWidth; //outline总宽度
};

#endif // MUSICSLIDER_H
